3.2.56 \(\int x^2 (a+b \log (c x^n)) (d+e \log (f x^r)) \, dx\) [156]

Optimal. Leaf size=84 \[ \frac {1}{27} b e n r x^3-\frac {1}{27} e r x^3 \left (3 a-b n+3 b \log \left (c x^n\right )\right )-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right ) \]

[Out]

1/27*b*e*n*r*x^3-1/27*e*r*x^3*(3*a-b*n+3*b*ln(c*x^n))-1/9*b*n*x^3*(d+e*ln(f*x^r))+1/3*x^3*(a+b*ln(c*x^n))*(d+e
*ln(f*x^r))

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2341, 2413, 12} \begin {gather*} \frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-\frac {1}{27} e r x^3 \left (3 a+3 b \log \left (c x^n\right )-b n\right )-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{27} b e n r x^3 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2*(a + b*Log[c*x^n])*(d + e*Log[f*x^r]),x]

[Out]

(b*e*n*r*x^3)/27 - (e*r*x^3*(3*a - b*n + 3*b*Log[c*x^n]))/27 - (b*n*x^3*(d + e*Log[f*x^r]))/9 + (x^3*(a + b*Lo
g[c*x^n])*(d + e*Log[f*x^r]))/3

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2413

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.) + Log[(f_.)*(x_)^(r_.)]*(e_.))*((g_.)*(x_))^(m_.), x_Sy
mbol] :> With[{u = IntHide[(g*x)^m*(a + b*Log[c*x^n])^p, x]}, Dist[d + e*Log[f*x^r], u, x] - Dist[e*r, Int[Sim
plifyIntegrand[u/x, x], x], x]] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, r}, x] &&  !(EqQ[p, 1] && EqQ[a, 0] &&
 NeQ[d, 0])

Rubi steps

\begin {align*} \int x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right ) \, dx &=-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-(e r) \int \frac {1}{9} x^2 \left (3 a \left (1-\frac {b n}{3 a}\right )+3 b \log \left (c x^n\right )\right ) \, dx\\ &=-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-\frac {1}{9} (e r) \int x^2 \left (3 a \left (1-\frac {b n}{3 a}\right )+3 b \log \left (c x^n\right )\right ) \, dx\\ &=\frac {1}{27} b e n r x^3-\frac {1}{27} e r x^3 \left (3 a-b n+3 b \log \left (c x^n\right )\right )-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 71, normalized size = 0.85 \begin {gather*} \frac {1}{27} x^3 \left (9 a d-3 b d n-3 a e r+2 b e n r+(9 a e-3 b e n) \log \left (f x^r\right )+3 b \log \left (c x^n\right ) \left (3 d-e r+3 e \log \left (f x^r\right )\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2*(a + b*Log[c*x^n])*(d + e*Log[f*x^r]),x]

[Out]

(x^3*(9*a*d - 3*b*d*n - 3*a*e*r + 2*b*e*n*r + (9*a*e - 3*b*e*n)*Log[f*x^r] + 3*b*Log[c*x^n]*(3*d - e*r + 3*e*L
og[f*x^r])))/27

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.17, size = 1640, normalized size = 19.52

method result size
risch \(\text {Expression too large to display}\) \(1640\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a+b*ln(c*x^n))*(d+e*ln(f*x^r)),x,method=_RETURNVERBOSE)

[Out]

1/3*x^3*a*d+(1/3*b*e*x^3*ln(x^n)-1/6*I*Pi*b*e*x^3*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+1/6*I*Pi*b*e*x^3*csgn(I*
c)*csgn(I*c*x^n)^2+1/6*I*Pi*b*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)^2-1/6*I*Pi*b*e*x^3*csgn(I*c*x^n)^3+1/3*ln(c)*b*e
*x^3-1/9*b*e*n*x^3+1/3*x^3*a*e)*ln(x^r)+1/6*I*ln(f)*Pi*b*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)^2-1/18*I*Pi*b*e*r*x^3
*csgn(I*x^n)*csgn(I*c*x^n)^2-1/9*a*e*r*x^3-1/9*b*e*r*x^3*ln(x^n)+1/12*Pi^2*b*e*x^3*csgn(I*f*x^r)^3*csgn(I*c)*c
sgn(I*c*x^n)^2+1/3*ln(f)*ln(c)*b*e*x^3-1/9*ln(f)*b*e*n*x^3-1/9*ln(c)*b*e*r*x^3+1/3*ln(c)*b*d*x^3+1/3*ln(f)*a*e
*x^3+1/3*b*d*x^3*ln(x^n)+1/6*I*Pi*b*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gn(I*c*x^n)-1/18*I*Pi*b*e*n*x^3*csgn(I*f)*csgn(I*f*x^
r)^2+1/6*I*Pi*b*d*x^3*csgn(I*c)*csgn(I*c*x^n)^2-1/6*I*Pi*a*e*x^3*csgn(I*f)*csgn(I*x^r)*csgn(I*f*x^r)+1/12*Pi^2
*b*e*x^3*csgn(I*f)*csgn(I*f*x^r)^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 108, normalized size = 1.29 \begin {gather*} -\frac {1}{9} \, b d n x^{3} - \frac {1}{9} \, a r x^{3} e + \frac {1}{3} \, b d x^{3} \log \left (c x^{n}\right ) + \frac {1}{3} \, a x^{3} e \log \left (f x^{r}\right ) + \frac {1}{3} \, a d x^{3} + \frac {1}{27} \, {\left ({\left (2 \, r - 3 \, \log \left (f\right )\right )} x^{3} - 3 \, x^{3} \log \left (x^{r}\right )\right )} b n e - \frac {1}{9} \, {\left (r x^{3} - 3 \, x^{3} \log \left (f x^{r}\right )\right )} b e \log \left (c x^{n}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="maxima")

[Out]

-1/9*b*d*n*x^3 - 1/9*a*r*x^3*e + 1/3*b*d*x^3*log(c*x^n) + 1/3*a*x^3*e*log(f*x^r) + 1/3*a*d*x^3 + 1/27*((2*r -
3*log(f))*x^3 - 3*x^3*log(x^r))*b*n*e - 1/9*(r*x^3 - 3*x^3*log(f*x^r))*b*e*log(c*x^n)

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 145, normalized size = 1.73 \begin {gather*} \frac {1}{3} \, b n r x^{3} e \log \left (x\right )^{2} + \frac {1}{27} \, {\left (2 \, b n - 3 \, a\right )} r x^{3} e - \frac {1}{9} \, {\left (b d n - 3 \, a d\right )} x^{3} - \frac {1}{9} \, {\left (b r x^{3} e - 3 \, b d x^{3}\right )} \log \left (c\right ) + \frac {1}{9} \, {\left (3 \, b x^{3} e \log \left (c\right ) - {\left (b n - 3 \, a\right )} x^{3} e\right )} \log \left (f\right ) + \frac {1}{9} \, {\left (3 \, b r x^{3} e \log \left (c\right ) + 3 \, b n x^{3} e \log \left (f\right ) + 3 \, b d n x^{3} - {\left (2 \, b n - 3 \, a\right )} r x^{3} e\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="fricas")

[Out]

1/3*b*n*r*x^3*e*log(x)^2 + 1/27*(2*b*n - 3*a)*r*x^3*e - 1/9*(b*d*n - 3*a*d)*x^3 - 1/9*(b*r*x^3*e - 3*b*d*x^3)*
log(c) + 1/9*(3*b*x^3*e*log(c) - (b*n - 3*a)*x^3*e)*log(f) + 1/9*(3*b*r*x^3*e*log(c) + 3*b*n*x^3*e*log(f) + 3*
b*d*n*x^3 - (2*b*n - 3*a)*r*x^3*e)*log(x)

________________________________________________________________________________________

Sympy [A]
time = 2.40, size = 128, normalized size = 1.52 \begin {gather*} \frac {a d x^{3}}{3} - \frac {a e r x^{3}}{9} + \frac {a e x^{3} \log {\left (f x^{r} \right )}}{3} - \frac {b d n x^{3}}{9} + \frac {b d x^{3} \log {\left (c x^{n} \right )}}{3} + \frac {2 b e n r x^{3}}{27} - \frac {b e n x^{3} \log {\left (f x^{r} \right )}}{9} - \frac {b e r x^{3} \log {\left (c x^{n} \right )}}{9} + \frac {b e x^{3} \log {\left (c x^{n} \right )} \log {\left (f x^{r} \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(a+b*ln(c*x**n))*(d+e*ln(f*x**r)),x)

[Out]

a*d*x**3/3 - a*e*r*x**3/9 + a*e*x**3*log(f*x**r)/3 - b*d*n*x**3/9 + b*d*x**3*log(c*x**n)/3 + 2*b*e*n*r*x**3/27
 - b*e*n*x**3*log(f*x**r)/9 - b*e*r*x**3*log(c*x**n)/9 + b*e*x**3*log(c*x**n)*log(f*x**r)/3

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (79) = 158\).
time = 4.66, size = 161, normalized size = 1.92 \begin {gather*} \frac {1}{3} \, b n r x^{3} e \log \left (x\right )^{2} - \frac {2}{9} \, b n r x^{3} e \log \left (x\right ) + \frac {1}{3} \, b r x^{3} e \log \left (c\right ) \log \left (x\right ) + \frac {1}{3} \, b n x^{3} e \log \left (f\right ) \log \left (x\right ) + \frac {2}{27} \, b n r x^{3} e - \frac {1}{9} \, b r x^{3} e \log \left (c\right ) - \frac {1}{9} \, b n x^{3} e \log \left (f\right ) + \frac {1}{3} \, b x^{3} e \log \left (c\right ) \log \left (f\right ) + \frac {1}{3} \, b d n x^{3} \log \left (x\right ) + \frac {1}{3} \, a r x^{3} e \log \left (x\right ) - \frac {1}{9} \, b d n x^{3} - \frac {1}{9} \, a r x^{3} e + \frac {1}{3} \, b d x^{3} \log \left (c\right ) + \frac {1}{3} \, a x^{3} e \log \left (f\right ) + \frac {1}{3} \, a d x^{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="giac")

[Out]

1/3*b*n*r*x^3*e*log(x)^2 - 2/9*b*n*r*x^3*e*log(x) + 1/3*b*r*x^3*e*log(c)*log(x) + 1/3*b*n*x^3*e*log(f)*log(x)
+ 2/27*b*n*r*x^3*e - 1/9*b*r*x^3*e*log(c) - 1/9*b*n*x^3*e*log(f) + 1/3*b*x^3*e*log(c)*log(f) + 1/3*b*d*n*x^3*l
og(x) + 1/3*a*r*x^3*e*log(x) - 1/9*b*d*n*x^3 - 1/9*a*r*x^3*e + 1/3*b*d*x^3*log(c) + 1/3*a*x^3*e*log(f) + 1/3*a
*d*x^3

________________________________________________________________________________________

Mupad [B]
time = 4.04, size = 82, normalized size = 0.98 \begin {gather*} \ln \left (f\,x^r\right )\,\left (\frac {a\,e\,x^3}{3}-\frac {b\,e\,n\,x^3}{9}+\frac {b\,e\,x^3\,\ln \left (c\,x^n\right )}{3}\right )+x^3\,\left (\frac {a\,d}{3}-\frac {b\,d\,n}{9}-\frac {a\,e\,r}{9}+\frac {2\,b\,e\,n\,r}{27}\right )+\frac {b\,x^3\,\ln \left (c\,x^n\right )\,\left (3\,d-e\,r\right )}{9} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(d + e*log(f*x^r))*(a + b*log(c*x^n)),x)

[Out]

log(f*x^r)*((a*e*x^3)/3 - (b*e*n*x^3)/9 + (b*e*x^3*log(c*x^n))/3) + x^3*((a*d)/3 - (b*d*n)/9 - (a*e*r)/9 + (2*
b*e*n*r)/27) + (b*x^3*log(c*x^n)*(3*d - e*r))/9

________________________________________________________________________________________